<template>
	<div class="riskpage">
		<!-- <div class="page-title">
			<img src="../assets/img/ico.png" alt="" srcset="">
			<p>风控流水</p>
		</div> -->
		<div class="list-box">
			<el-table :data="list" v-loading="loading" height="100%" stripe style="width: 100%;" header-row-class-name="headcss">
				<el-table-column prop="Max" label="当日分配上限" align="center"></el-table-column>
				<el-table-column prop="Total" label="当日实际分配" align="center"></el-table-column>
				<el-table-column prop="Ratio" label="风控比" align="center"></el-table-column>
				<el-table-column prop="Price" label="代币价格" align="center"></el-table-column>
				<el-table-column prop="CreateTime" label="日期" align="center"></el-table-column>
				<el-table-column prop="RealAvailable" label="当日实际可领取总量" align="center"></el-table-column>
			</el-table>
		</div>
		<div class="page-limit">
			<el-pagination
			    @size-change="SizeChange"
			    @current-change="CurrentChange"
			    :current-page="currentPage"
			    :page-sizes="[15, 50, 100, 200]"
			    :page-size="size"
			    layout="total, sizes, prev, pager, next, jumper"
			    :total="total">
			</el-pagination>
		</div>
	</div>
</template>
<script>
	import {riskControl} from '@/utils/api'
	export default {
		data() {
			return {
				currentPage:1,
				size:15,
				total:0,
				list: [],
				loading:false
			}
		},
		mounted() {
			this._riskControl()
		},
		methods:{
			async _riskControl(){
				this.loading = true
				let {data,response} = await riskControl({size:this.size,page:this.currentPage-1})
				let {dataList,total} = data
				this.loading = false
				this.total = total
				this.list = dataList
			},
			SizeChange(size){
				this.size = size
				this.currentPage=1
				this._riskControl()
			},
			CurrentChange(page){
				this.currentPage = page
				this._riskControl()
			}
		}
	}
</script>

<style scoped lang="scss">
	.riskpage {
		padding: 20px 0 20px 20px;
		height: 100%;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		box-sizing: border-box;
	}
	.list-box{
		flex: 1;
		overflow-y: scroll;
	}
	.page-limit{
		display: flex;
		justify-content: center;
		padding-top: 10px;
	}
	.page-title {
		display: flex;
		align-items: center;
		padding-bottom: 20px;

		p {
			margin-left: 10px;
			font-size: 24px;
			color: #333333;
		}

		img {
			width: 24px;
		}
	}
</style>
<style>
	.el-table{
		border-radius: 5px;
	}
	.el-table th.el-table__cell{
		background-color: #2389FD!important;
		color: #fff;
	}
	.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell{
		background:#DEEEFF!important;
	}
	.el-table td.el-table__cell{
		border:none
	}
</style>